<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="华为Mate 70 Pro - 麒麟9 Gen3芯片+超感光影像系统，5000mAh长续航，HarmonyOS 4.0旗舰手机">
    <meta name="keywords" content="华为Mate 70 Pro, 麒麟9 Gen3, 超感光影像, 5G旗舰, HarmonyOS 4.0">
    <title>华为Mate 70 Pro - HUAWEI Global Store</title>
    <style>
        /* 全局样式重置与基础设置 */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
            background: #f8fafc;
            color: #1f2937;
            overflow-x: hidden;
            line-height: 1.7;
        }

        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 20px;
        }

        /* 通用组件样式 */
        .btn {
            padding: 12px 24px;
            border: none;
            border-radius: 10px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }

        .btn-primary {
            background: linear-gradient(135deg, #3b82f6, #1d4ed8);
            color: white;
        }

        .btn-primary:hover {
            background: linear-gradient(135deg, #1d4ed8, #1e40af);
            transform: translateY(-2px);
            box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
        }

        .btn-primary:active {
            transform: translateY(0);
            box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2);
        }

        .btn-outline {
            background: transparent;
            border: 2px solid #3b82f6;
            color: #3b82f6;
            transition: all 0.3s ease;
        }

        .btn-outline:hover {
            background: rgba(59, 130, 246, 0.1);
            transform: translateY(-2px);
        }

        .btn-outline:active {
            transform: translateY(0);
        }

        .section-title {
            font-size: 28px;
            font-weight: 700;
            margin-bottom: 20px;
            color: #1f2937;
            position: relative;
            padding-left: 16px;
        }

        .section-title::before {
            content: "";
            position: absolute;
            left: 0;
            top: 50%;
            transform: translateY(-50%);
            width: 4px;
            height: 24px;
            background: #3b82f6;
            border-radius: 2px;
        }

        .disabled-btn {
            background: #e5e7eb !important;
            border-color: #d1d5db !important;
            color: #9ca3af !important;
            cursor: not-allowed !important;
            transform: none !important;
            box-shadow: none !important;
        }

        /* 标签组件 */
        .tag {
            display: inline-block;
            padding: 4px 10px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 500;
            margin-right: 8px;
            margin-bottom: 8px;
        }

        .tag-primary {
            background: #dbeafe;
            color: #1d4ed8;
        }

        .tag-hot {
            background: #fee2e2;
            color: #dc2626;
        }

        .tag-new {
            background: #dcfce7;
            color: #166534;
        }

        /* 倒计时组件 */
        .countdown {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-top: 10px;
            padding: 8px 12px;
            background: #fff1f2;
            border-radius: 8px;
            width: fit-content;
        }

        .countdown-icon {
            color: #ef4444;
            font-size: 16px;
        }

        .countdown-text {
            font-size: 14px;
            color: #dc2626;
            font-weight: 500;
        }

        .countdown-time {
            display: flex;
            gap: 4px;
        }

        .countdown-unit {
            background: #ef4444;
            color: white;
            padding: 2px 6px;
            border-radius: 4px;
            font-size: 14px;
            font-weight: 600;
        }

        /* 头部导航样式 */
        .header {
            background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
            color: white;
            padding: 15px 0;
            box-shadow: 0 4px 20px rgba(0,0,0,0.1);
            position: sticky;
            top: 0;
            z-index: 1000;
        }

        .header-content {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 20px;
        }

        .logo {
            font-size: 28px;
            font-weight: bold;
            display: flex;
            align-items: center;
            gap: 10px;
            cursor: pointer;
            transition: transform 0.3s ease;
        }

        .logo:hover {
            transform: scale(1.05);
        }

        .logo::before {
            content: "🌐";
            font-size: 24px;
        }

        /* 汉堡菜单（移动端） */
        #hamburger {
            display: none;
            flex-direction: column;
            gap: 6px;
            cursor: pointer;
            padding: 8px;
            border-radius: 6px;
            background: rgba(255,255,255,0.2);
            transition: background 0.3s ease;
            aria-label: "打开导航菜单";
        }

        #hamburger:hover {
            background: rgba(255,255,255,0.3);
        }

        .hamburger-line {
            width: 24px;
            height: 3px;
            background: white;
            border-radius: 3px;
            transition: all 0.3s ease;
        }

        .nav {
            display: flex;
            gap: 30px;
            align-items: center;
        }

        .nav a {
            color: white;
            text-decoration: none;
            font-weight: 500;
            transition: all 0.3s ease;
            padding: 8px 12px;
            border-radius: 8px;
            position: relative;
        }

        .nav a::after {
            content: "";
            position: absolute;
            bottom: 0;
            left: 0;
            width: 0;
            height: 2px;
            background: white;
            transition: width 0.3s ease;
        }

        .nav a:hover {
            background: rgba(255,255,255,0.2);
            transform: translateY(-2px);
        }

        .nav a:hover::after {
            width: 100%;
        }

        .nav a[href="product-list.html"] {
            background: rgba(255,255,255,0.25);
            font-weight: 600;
        }

        .user-actions {
            display: flex;
            gap: 15px;
            align-items: center;
        }

        .user-actions select {
            padding: 8px 12px;
            border-radius: 8px;
            border: none;
            background: white;
            font-size: 14px;
            cursor: pointer;
            transition: box-shadow 0.3s ease;
        }

        .user-actions select:focus {
            outline: none;
            box-shadow: 0 0 0 3px rgba(255,255,255,0.5);
        }

        /* 购物车图标 */
        #cartIcon {
            position: relative;
            padding: 10px;
            background: rgba(255,255,255,0.2);
            border-radius: 50%;
            cursor: pointer;
            transition: all 0.3s ease;
            aria-label: "打开购物车";
        }

        #cartIcon:hover {
            background: rgba(255,255,255,0.3);
            transform: scale(1.1);
        }

        .cart-count {
            position: absolute;
            top: -5px;
            right: -5px;
            background: #ef4444;
            color: white;
            border-radius: 50%;
            width: 20px;
            height: 20px;
            font-size: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: transform 0.3s ease;
        }

        .cart-count.bounce {
            animation: bounce 0.5s ease;
        }

        @keyframes bounce {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.3); }
        }

        /* 产品页面主体样式 */
        .product-page {
            padding: 40px 0;
        }

        .breadcrumb {
            font-size: 14px;
            color: #6b7280;
            margin-bottom: 20px;
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }

        .breadcrumb a {
            color: #6b7280;
            text-decoration: none;
        }

        .breadcrumb a:hover {
            color: #3b82f6;
            text-decoration: underline;
        }

        .breadcrumb span:last-child {
            color: #1f2937;
            font-weight: 500;
        }

        .product-container {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 40px;
            margin-top: 30px;
            align-items: start;
        }

        /* 产品图片展示区 - 优化预览功能 */
        .product-gallery {
            display: flex;
            flex-direction: column;
            gap: 20px;
            animation: fadeIn 0.6s ease-out;
        }

        .main-image {
            width: 100%;
            height: 500px;
            background: #f1f5f9;
            border-radius: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            position: relative;
            transition: all 0.3s ease;
            box-shadow: 0 10px 30px rgba(0,0,0,0.05);
            cursor: zoom-in;
        }

        .main-image.zoomed {
            cursor: zoom-out;
        }

        .main-image img {
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
            transition: transform 0.5s ease;
        }

        .main-image:hover img {
            transform: scale(1.05);
        }

        .main-image.zoomed img {
            transform: scale(2);
        }

        .thumbnail-list {
            display: flex;
            gap: 12px;
            overflow-x: auto;
            padding-bottom: 10px;
            scrollbar-width: thin;
            scrollbar-color: #3b82f6 #f1f5f9;
        }

        .thumbnail-list::-webkit-scrollbar {
            height: 6px;
        }

        .thumbnail-list::-webkit-scrollbar-track {
            background: #f1f5f9;
            border-radius: 3px;
        }

        .thumbnail-list::-webkit-scrollbar-thumb {
            background: #3b82f6;
            border-radius: 3px;
        }

        .thumbnail {
            width: 80px;
            height: 80px;
            background: #f1f5f9;
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.3s ease;
            flex-shrink: 0;
            overflow: hidden;
            border: 2px solid transparent;
        }

        .thumbnail.active {
            border-color: #3b82f6;
            box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
        }

        .thumbnail:hover {
            transform: translateY(-3px);
            box-shadow: 0 4px 8px rgba(0,0,0,0.08);
        }

        .thumbnail img {
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
        }

        /* 产品详情区 - 优化内容层次 */
        .product-details {
            animation: fadeIn 0.6s ease-out 0.2s both;
        }

        .product-detail-title {
            font-size: 32px;
            font-weight: 700;
            margin-bottom: 15px;
            color: #1f2937;
            line-height: 1.3;
        }

        .product-tags {
            margin-bottom: 15px;
        }

        .product-status {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 15px;
            font-size: 14px;
        }

        .status-instock {
            color: #166534;
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .status-instock::before {
            content: "●";
            color: #22c55e;
            font-size: 16px;
        }

        .status-shipping {
            color: #6b7280;
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .status-shipping::before {
            content: "🚚";
            font-size: 16px;
        }

        .product-rating {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 20px;
        }

        .stars {
            color: #f59e0b;
            font-size: 20px;
        }

        .rating-text {
            font-size: 14px;
            color: #6b7280;
        }

        .product-detail-price {
            margin-bottom: 30px;
            padding-bottom: 20px;
            border-bottom: 1px solid #e2e8f0;
        }

        .current-price {
            font-size: 32px;
            font-weight: 700;
            color: #ef4444;
            margin-bottom: 8px;
        }

        .original-price {
            font-size: 16px;
            color: #6b7280;
            text-decoration: line-through;
            margin-right: 10px;
        }

        .discount-badge {
            background: #fee2e2;
            color: #dc2626;
            padding: 3px 8px;
            border-radius: 4px;
            font-size: 14px;
            font-weight: 500;
        }

        .global-pricing {
            display: flex;
            flex-wrap: wrap;
            gap: 15px;
            margin-top: 10px;
            font-size: 14px;
            color: #6b7280;
        }

        /* 规格选择区 - 增强视觉反馈 */
        .spec-selector {
            margin-bottom: 30px;
        }

        .spec-title {
            font-weight: 600;
            margin-bottom: 15px;
            color: #1f2937;
            font-size: 18px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .spec-title::before {
            content: "";
            width: 4px;
            height: 4px;
            border-radius: 50%;
            background: #3b82f6;
        }

        .spec-options {
            display: flex;
            flex-wrap: wrap;
            gap: 12px;
        }

        .spec-option {
            padding: 12px 20px;
            border: 1px solid #e2e8f0;
            border-radius: 10px;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            font-size: 16px;
            position: relative;
        }

        .spec-option.selected {
            border-color: #3b82f6;
            background: rgba(59, 130, 246, 0.1);
            font-weight: 600;
        }

        .spec-option.selected::after {
            content: "✓";
            color: #3b82f6;
            margin-left: 8px;
        }

        .spec-option.hot::before {
            content: "热门";
            position: absolute;
            top: -8px;
            right: -8px;
            background: #ef4444;
            color: white;
            font-size: 10px;
            padding: 2px 6px;
            border-radius: 10px;
        }

        .spec-option:hover:not(.selected) {
            border-color: #94a3b8;
            background: #f1f5f9;
            transform: translateY(-2px);
        }

        /* 数量选择和购买按钮区 */
        .quantity-and-actions {
            margin-bottom: 30px;
            padding-bottom: 20px;
            border-bottom: 1px solid #e2e8f0;
        }

        .quantity-selector {
            display: flex;
            align-items: center;
            margin-bottom: 20px;
            gap: 15px;
        }

        .quantity-selector span {
            font-weight: 600;
            color: #1f2937;
        }

        .quantity-controls {
            display: flex;
            align-items: center;
            border: 1px solid #e2e8f0;
            border-radius: 10px;
            overflow: hidden;
        }

        .quantity-btn {
            width: 40px;
            height: 40px;
            background: #f8fafc;
            border: none;
            font-size: 20px;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .quantity-btn:hover {
            background: #e2e8f0;
        }

        .quantity-input {
            width: 60px;
            height: 40px;
            border: none;
            text-align: center;
            font-size: 16px;
            background: transparent;
        }

        .quantity-input:focus {
            outline: none;
        }

        .action-buttons {
            display: flex;
            gap: 15px;
        }

        .action-buttons .btn {
            flex: 1;
            padding: 15px;
            font-size: 16px;
        }

        /* 产品信息卡片 */
        .product-info-cards {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
            gap: 15px;
            margin-bottom: 40px;
        }

        .info-card {
            background: white;
            border-radius: 12px;
            padding: 20px;
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
            box-shadow: 0 5px 15px rgba(0,0,0,0.05);
            transition: transform 0.3s ease;
        }

        .info-card:hover {
            transform: translateY(-5px);
        }

        .info-card-icon {
            font-size: 24px;
            margin-bottom: 10px;
            color: #3b82f6;
        }

        .info-card-title {
            font-weight: 600;
            margin-bottom: 5px;
            color: #1f2937;
        }

        .info-card-desc {
            font-size: 14px;
            color: #6b7280;
        }

        /* 用户评价预览区 */
        .user-reviews {
            background: white;
            border-radius: 16px;
            padding: 24px;
            margin-bottom: 40px;
            box-shadow: 0 5px 15px rgba(0,0,0,0.05);
        }

        .reviews-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
        }

        .reviews-title {
            font-size: 20px;
            font-weight: 600;
            color: #1f2937;
        }

        .reviews-link {
            color: #3b82f6;
            text-decoration: none;
            font-weight: 500;
            transition: color 0.3s ease;
        }

        .reviews-link:hover {
            color: #1d4ed8;
            text-decoration: underline;
        }

        .review-cards {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 20px;
        }

        .review-card {
            padding: 16px;
            border-radius: 12px;
            border: 1px solid #f1f5f9;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }

        .review-card:hover {
            transform: translateY(-3px);
            box-shadow: 0 5px 15px rgba(0,0,0,0.08);
        }

        .reviewer {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 10px;
        }

        .reviewer-avatar {
            width: 40px;
            height: 40px;
            background: #f1f5f9;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
            color: #3b82f6;
        }

        .reviewer-info {
            flex: 1;
        }

        .reviewer-name {
            font-weight: 500;
            margin-bottom: 2px;
        }

        .review-date {
            font-size: 12px;
            color: #6b7280;
        }

        .review-content {
            font-size: 14px;
            color: #4b5563;
            margin: 10px 0;
            line-height: 1.6;
        }

        .review-images {
            display: flex;
            gap: 8px;
            margin-top: 12px;
        }

        .review-image {
            width: 60px;
            height: 60px;
            border-radius: 8px;
            overflow: hidden;
        }

        .review-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        /* 产品特性和规格 */
        .product-features {
            margin-top: 60px;
            padding-top: 40px;
            border-top: 1px solid #e2e8f0;
        }

        .features-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 30px;
            margin-top: 30px;
        }

        .feature-card {
            background: white;
            border-radius: 16px;
            padding: 30px;
            box-shadow: 0 5px 20px rgba(0,0,0,0.05);
            transition: all 0.3s ease;
        }

        .feature-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 30px rgba(0,0,0,0.1);
        }

        .feature-icon {
            font-size: 36px;
            color: #3b82f6;
            margin-bottom: 15px;
        }

        .feature-title {
            font-size: 20px;
            font-weight: 600;
            margin-bottom: 10px;
            color: #1f2937;
        }

        .feature-desc {
            color: #6b7280;
            line-height: 1.7;
        }

        /* 场景化功能展示 */
        .feature-scenarios {
            margin-top: 60px;
        }

        .scenario-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 30px;
            margin-top: 30px;
        }

        .scenario-card {
            border-radius: 16px;
            overflow: hidden;
            background: white;
            box-shadow: 0 5px 20px rgba(0,0,0,0.05);
            transition: transform 0.3s ease;
        }

        .scenario-card:hover {
            transform: translateY(-5px);
        }

        .scenario-image {
            height: 200px;
            width: 100%;
            overflow: hidden;
        }

        .scenario-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.5s ease;
        }

        .scenario-card:hover .scenario-image img {
            transform: scale(1.05);
        }

        .scenario-content {
            padding: 24px;
        }

        .scenario-title {
            font-size: 18px;
            font-weight: 600;
            margin-bottom: 10px;
            color: #1f2937;
        }

        .scenario-desc {
            color: #6b7280;
            line-height: 1.7;
        }

        /* 规格表格优化 */
        .specifications-table-container {
            overflow-x: auto;
            margin-top: 30px;
        }

        .specifications-table {
            width: 100%;
            border-collapse: collapse;
            min-width: 768px;
        }

        .specifications-table th,
        .specifications-table td {
            padding: 15px;
            text-align: left;
            border-bottom: 1px solid #e2e8f0;
        }

        .specifications-table th {
            font-weight: 600;
            color: #1f2937;
            width: 30%;
            background: #f8fafc;
        }

        .specifications-table tr:last-child th,
        .specifications-table tr:last-child td {
            border-bottom: none;
        }

        .specifications-table td {
            color: #6b7280;
        }

        /* 底部固定购物栏 */
        .sticky-cart {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background: white;
            padding: 15px 20px;
            box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
            display: flex;
            align-items: center;
            justify-content: space-between;
            z-index: 900;
            transform: translateY(100%);
            transition: transform 0.3s ease;
        }

        .sticky-cart.show {
            transform: translateY(0);
        }

        .sticky-product-info {
            display: flex;
            align-items: center;
            gap: 15px;
        }

        .sticky-product-image {
            width: 50px;
            height: 50px;
            background: #f1f5f9;
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
        }

        .sticky-product-image img {
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
        }

        .sticky-cart .btn {
            min-width: 200px;
        }

        /* 页脚样式 */
        footer {
            background: #1f2937;
            color: white;
            padding: 50px 0 24px;
            margin-top: 80px;
        }

        .footer-content {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 32px;
            margin-bottom: 32px;
        }

        .footer-section h3 {
            margin-bottom: 18px;
            font-size: 18px;
            position: relative;
            padding-bottom: 8px;
        }

        .footer-section h3::after {
            content: "";
            position: absolute;
            bottom: 0;
            left: 0;
            width: 40px;
            height: 2px;
            background: #3b82f6;
            border-radius: 1px;
        }

        .footer-section ul {
            list-style: none;
        }

        .footer-section li {
            margin-bottom: 12px;
        }

        .footer-section a {
            color: #9ca3af;
            text-decoration: none;
            transition: color 0.3s ease, padding-left 0.3s ease;
            display: inline-block;
        }

        .footer-section a:hover {
            color: white;
            padding-left: 4px;
        }

        .footer-bottom {
            text-align: center;
            padding-top: 24px;
            border-top: 1px solid #374151;
            color: #9ca3af;
            font-size: 14px;
        }

        /* 登录模态框 */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0,0,0,0.5);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 2000;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s ease;
        }

        .modal-overlay.show {
            opacity: 1;
            visibility: visible;
        }

        .modal {
            background: white;
            border-radius: 16px;
            width: 90%;
            max-width: 400px;
            padding: 30px;
            transform: translateY(20px);
            transition: transform 0.3s ease;
        }

        .modal-overlay.show .modal {
            transform: translateY(0);
        }

        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 24px;
        }

        .modal-title {
            font-size: 22px;
            font-weight: 600;
            color: #1f2937;
        }

        .modal-close {
            background: none;
            border: none;
            font-size: 24px;
            cursor: pointer;
            color: #6b7280;
            transition: color 0.3s ease;
        }

        .modal-close:hover {
            color: #1f2937;
        }

        .form-group {
            margin-bottom: 20px;
        }

        .form-label {
            display: block;
            margin-bottom: 8px;
            font-weight: 500;
            color: #1f2937;
        }

        .form-input {
            width: 100%;
            padding: 12px 16px;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            font-size: 16px;
            transition: border-color 0.3s ease, box-shadow 0.3s ease;
        }

        .form-input:focus {
            outline: none;
            border-color: #3b82f6;
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
        }

        .form-actions {
            margin-top: 30px;
        }

        .form-actions .btn {
            width: 100%;
        }

        /* 动画效果 */
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* 购物车添加动画 */
        @keyframes addToCartAnimation {
            0% {
                opacity: 1;
                transform: scale(1);
            }
            50% {
                opacity: 0.8;
                transform: scale(1.2);
            }
            100% {
                opacity: 0;
                transform: translate(0, -50px) scale(0.5);
            }
        }

        .cart-animation {
            position: fixed;
            z-index: 1001;
            pointer-events: none;
            animation: addToCartAnimation 0.8s ease forwards;
        }

        /* 响应式设计 */
        @media (max-width: 992px) {
            .review-cards {
                grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
            }
        }

        @media (max-width: 768px) {
            /* 导航栏调整 */
            #hamburger {
                display: flex;
            }
            
            .nav {
                display: none;
                position: absolute;
                top: 75px;
                left: 0;
                right: 0;
                background: #1e40af;
                flex-direction: column;
                gap: 12px;
                padding: 20px;
                box-shadow: 0 10px 20px rgba(0,0,0,0.1);
                z-index: 999;
            }
            
            .nav.active {
                display: flex;
            }
            
            #hamburger.active .hamburger-line:nth-child(1) {
                transform: rotate(45deg) translate(5px, 5px);
            }
            #hamburger.active .hamburger-line:nth-child(2) {
                opacity: 0;
            }
            #hamburger.active .hamburger-line:nth-child(3) {
                transform: rotate(-45deg) translate(5px, -5px);
            }

            /* 产品布局调整 */
            .product-container {
                grid-template-columns: 1fr;
            }

            .main-image {
                height: 350px;
            }

            .product-detail-title {
                font-size: 26px;
            }

            .current-price {
                font-size: 28px;
            }

            /* 按钮布局调整 */
            .action-buttons {
                flex-direction: column;
            }

            .sticky-cart .btn {
                min-width: auto;
                flex: 1;
            }

            /* 特性布局调整 */
            .features-grid, .scenario-grid {
                grid-template-columns: 1fr;
            }

            /* 评价布局调整 */
            .review-cards {
                grid-template-columns: 1fr;
            }

            /* 移动端隐藏部分内容 */
            .global-pricing {
                display: none;
            }
        }

        @media (max-width: 480px) {
            .section-title {
                font-size: 24px;
            }
            
            .product-info-cards {
                grid-template-columns: repeat(2, 1fr);
            }
            
            .info-card {
                padding: 15px;
            }
            
            .info-card-icon {
                font-size: 20px;
            }
            
            .info-card-title {
                font-size: 14px;
            }
            
            .info-card-desc {
                font-size: 12px;
            }
            
            .spec-option {
                padding: 10px 16px;
                font-size: 14px;
            }
            
            .sticky-product-info div:last-child {
                font-size: 14px;
            }
            
            .sticky-cart .btn {
                padding: 12px;
                font-size: 14px;
            }
        }
    </style>
</head>
<body>
    <!-- 头部导航 -->
    <header class="header">
        <div class="container">
            <div class="header-content">
                <div class="logo" onclick="window.location.href='index.html'">HUAWEI Global Store</div>
                
                <!-- 汉堡菜单（移动端） -->
                <div id="hamburger" aria-expanded="false">
                    <div class="hamburger-line"></div>
                    <div class="hamburger-line"></div>
                    <div class="hamburger-line"></div>
                </div>
                
                <!-- 导航栏 -->
                <nav class="nav">
                    <a href="index.html">首页</a>
                    <a href="product-list.html" aria-current="page">新品</a>
                    <a href="support.html">支持</a>
                    <a href="about.html">关于</a>
                </nav>
                
                <div class="user-actions">
                    <select id="languageSelect">
                        <option>🇨🇳 中文</option>
                        <option>🇺🇸 English</option>
                        <option>🇯🇵 日本語</option>
                        <option>🇩🇪 Deutsch</option>
                    </select>
                    
                    <!-- 购物车 -->
                    <div id="cartIcon" aria-label="购物车" onclick="handleCartClick()">
                        🛒
                        <div class="cart-count" id="cartCount">0</div>
                    </div>
                    
                    <!-- 登录/个人中心按钮 -->
                    <button id="loginBtn" class="btn btn-outline" style="color: white; border-color: white;" onclick="openLoginModal()">
                        登录
                    </button>
                    <button id="profileBtn" class="btn btn-outline" style="color: white; border-color: white;" onclick="handleProfileClick()">
                        个人中心
                    </button>
                </div>
            </div>
        </div>
    </header>

    <!-- 登录模态框 -->
    <div class="modal-overlay" id="loginModal">
        <div class="modal">
            <div class="modal-header">
                <h3 class="modal-title">账户登录</h3>
                <button class="modal-close" id="modalClose" onclick="closeLoginModal()">×</button>
            </div>
            <form id="loginForm">
                <div class="form-group">
                    <label class="form-label" for="username">用户名/手机号</label>
                    <input type="text" id="username" class="form-input" required>
                </div>
                <div class="form-group">
                    <label class="form-label" for="password">密码</label>
                    <input type="password" id="password" class="form-input" required>
                </div>
                <div class="form-actions">
                    <button type="submit" class="btn btn-primary">登录</button>
                </div>
            </form>
        </div>
    </div>

    <!-- 产品页面主体 -->
    <section class="product-page">
        <div class="container">
            <!-- 面包屑导航 -->
            <div class="breadcrumb">
                <span><a href="index.html">首页</a> &gt; </span>
                <span><a href="product-list.html">手机</a> &gt; </span>
                <span><a href="product-list.html">Mate系列</a> &gt; </span>
                <span>华为Mate 70 Pro</span>
            </div>

            <div class="product-container">
                <!-- 产品图片展示 -->
                <div class="product-gallery">
                    <div class="main-image" id="mainImage" onclick="toggleImageZoom()">
                        <img src="https://picsum.photos/id/1/600/600" alt="华为Mate 70 Pro 正面展示" loading="lazy">
                    </div>
                    <div class="thumbnail-list">
                        <div class="thumbnail active" onclick="changeMainImage('https://picsum.photos/id/1/600/600', '华为Mate 70 Pro 正面展示')">
                            <img src="https://picsum.photos/id/1/100/100" alt="正面缩略图">
                        </div>
                        <div class="thumbnail" onclick="changeMainImage('https://picsum.photos/id/2/600/600', '华为Mate 70 Pro 背面展示')">
                            <img src="https://picsum.photos/id/2/100/100" alt="背面缩略图">
                        </div>
                        <div class="thumbnail" onclick="changeMainImage('https://picsum.photos/id/3/600/600', '华为Mate 70 Pro 侧面展示')">
                            <img src="https://picsum.photos/id/3/100/100" alt="侧面缩略图">
                        </div>
                        <div class="thumbnail" onclick="changeMainImage('https://picsum.photos/id/4/600/600', '华为Mate 70 Pro 摄像头展示')">
                            <img src="https://picsum.photos/id/4/100/100" alt="摄像头缩略图">
                        </div>
                        <div class="thumbnail" onclick="changeMainImage('https://picsum.photos/id/5/600/600', '华为Mate 70 Pro 配件展示')">
                            <img src="https://picsum.photos/id/5/100/100" alt="配件缩略图">
                        </div>
                    </div>
                </div>

                <!-- 产品详情 -->
                <div class="product-details">
                    <h1 class="product-detail-title">华为Mate 70 Pro</h1>
                    
                    <div class="product-tags">
                        <span class="tag tag-new">新品上市</span>
                        <span class="tag tag-primary">麒麟芯片</span>
                        <span class="tag tag-hot">热销中</span>
                    </div>
                    
                    <div class="product-status">
                        <div class="status-instock">有货，24小时内发货</div>
                        <div class="status-shipping">支持全国联保</div>
                    </div>
                    
                    <div class="product-rating">
                        <div class="stars">
                            <span class="star">★</span>
                            <span class="star">★</span>
                            <span class="star">★</span>
                            <span class="star">★</span>
                            <span class="star">★</span>
                        </div>
                        <span class="rating-text">4.9 (2,847 评价) | 已售出 15,632 台</span>
                    </div>

                    <div class="product-detail-price">
                        <div class="current-price">¥6,999</div>
                        <div>
                            <span class="original-price">¥7,999</span>
                            <span class="discount-badge">限时优惠 ¥1000</span>
                        </div>
                        <div class="countdown">
                            <span class="countdown-icon">⏰</span>
                            <span class="countdown-text">优惠结束还剩：</span>
                            <div class="countdown-time">
                                <span class="countdown-unit" id="hours">12</span>:
                                <span class="countdown-unit" id="minutes">34</span>:
                                <span class="countdown-unit" id="seconds">56</span>
                            </div>
                        </div>
                        <div class="global-pricing">
                            <span>🇺🇸 $999</span>
                            <span>🇪🇺 €899</span>
                            <span>🇯🇵 ¥149,800</span>
                        </div>
                    </div>

                    <!-- 存储容量选择 -->
                    <div class="spec-selector">
                        <div class="spec-title">存储容量</div>
                        <div class="spec-options">
                            <div class="spec-option selected hot" data-price="6999" onclick="selectSpec(this, '256GB')">
                                <div>256GB</div>
                            </div>
                            <div class="spec-option" data-price="7599" onclick="selectSpec(this, '512GB')">
                                <div>512GB</div>
                            </div>
                            <div class="spec-option" data-price="8599" onclick="selectSpec(this, '1TB')">
                                <div>1TB</div>
                            </div>
                        </div>
                    </div>

                    <!-- 颜色选择 -->
                    <div class="spec-selector">
                        <div class="spec-title">颜色选择</div>
                        <div class="spec-options">
                            <div class="spec-option selected" onclick="selectSpec(this, '雅黑')">
                                <div style="width: 20px; height: 20px; background: #000; border-radius: 50%; margin-right: 10px;"></div>
                                雅黑
                            </div>
                            <div class="spec-option" onclick="selectSpec(this, '冰霜银')">
                                <div style="width: 20px; height: 20px; background: #c0c0c0; border-radius: 50%; margin-right: 10px;"></div>
                                冰霜银
                            </div>
                            <div class="spec-option hot" onclick="selectSpec(this, '远山蓝')">
                                <div style="width: 20px; height: 20px; background: #4169E1; border-radius: 50%; margin-right: 10px;"></div>
                                远山蓝
                            </div>
                            <div class="spec-option" onclick="selectSpec(this, '樱语粉')">
                                <div style="width: 20px; height: 20px; background: #FFB6C1; border-radius: 50%; margin-right: 10px;"></div>
                                樱语粉
                            </div>
                        </div>
                    </div>

                    <!-- 数量选择和购买按钮 -->
                    <div class="quantity-and-actions">
                        <div class="quantity-selector">
                            <span>数量:</span>
                            <div class="quantity-controls">
                                <button class="quantity-btn" onclick="changeQuantity(-1)">−</button>
                                <input type="number" class="quantity-input" value="1" min="1" max="10" id="quantityInput">
                                <button class="quantity-btn" onclick="changeQuantity(1)">+</button>
                            </div>
                        </div>
                        <div class="action-buttons">
                            <button class="btn btn-primary" onclick="buyNow()">
                                ⚡ 立即抢购
                            </button>
                            <button class="btn btn-outline" onclick="addToCart(event)">
                                🛒 加入购物车
                            </button>
                        </div>
                    </div>
                </div>
            </div>

            <!-- 产品特性 -->
            <div class="product-features">
                <h2 class="section-title">产品特性</h2>
                <div class="features-grid">
                    <div class="feature-card">
                        <div class="feature-icon">🚀</div>
                        <h3 class="feature-title">全新麒麟9 Gen3芯片</h3>
                        <p class="feature-desc">采用4nm工艺制程，CPU性能提升30%，GPU性能提升40%，带来更强劲的处理能力和更流畅的操作体验。</p>
                    </div>
                    <div class="feature-card">
                        <div class="feature-icon">📷</div>
                        <h3 class="feature-title">超感光影像系统</h3>
                        <p class="feature-desc">5000万像素超感光主摄+4000万像素超广角+800万像素潜望式长焦，支持10倍光学变焦和50倍数字变焦，夜景拍摄能力大幅提升。</p>
                    </div>
                    <div class="feature-card">
                        <div class="feature-icon">🔋</div>
                        <h3 class="feature-title">5000mAh超大电池</h3>
                        <p class="feature-desc">配备5000mAh大容量电池，支持88W有线超级快充和50W无线超级快充，30分钟即可充至85%。</p>
                    </div>
                    <div class="feature-card">
                        <div class="feature-icon">✨</div>
                        <h3 class="feature-title">HarmonyOS 4.0</h3>
                        <p class="feature-desc">搭载最新HarmonyOS 4.0系统，带来更流畅的操作体验、更智能的交互方式和更安全的隐私保护。</p>
                    </div>
                </div>
            </div>

            <!-- 场景化功能展示 -->
            <div class="feature-scenarios">
                <h2 class="section-title">场景化体验</h2>
                <div class="scenario-grid">
                    <div class="scenario-card">
                        <div class="scenario-image">
                            <img src="https://picsum.photos/id/30/600/400" alt="户外摄影场景">
                        </div>
                        <div class="scenario-content">
                            <h3 class="scenario-title">专业户外摄影</h3>
                            <p class="scenario-desc">超感光影像系统在各种光线条件下都能捕捉精彩瞬间，无论是日出日落还是夜景星空，都能拍出专业级照片。</p>
                        </div>
                    </div>
                    <div class="scenario-card">
                        <div class="scenario-image">
                            <img src="https://picsum.photos/id/31/600/400" alt="移动办公场景">
                        </div>
                        <div class="scenario-content">
                            <h3 class="scenario-title">高效移动办公</h3>
                            <p class="scenario-desc">强大的麒麟芯片配合HarmonyOS多设备协同能力，让手机成为你的移动办公中心，轻松处理文档和会议。</p>
                        </div>
                    </div>
                    <div class="scenario-card">
                        <div class="scenario-image">
                            <img src="https://picsum.photos/id/32/600/400" alt="娱乐游戏场景">
                        </div>
                        <div class="scenario-content">
                            <h3 class="scenario-title">沉浸式娱乐体验</h3>
                            <p class="scenario-desc">120Hz高刷新率屏幕搭配立体双扬声器，带来震撼的游戏和影音体验，强劲性能确保长时间流畅运行。</p>
                        </div>
                    </div>
                </div>
            </div>

            <!-- 产品规格 -->
            <div class="product-features">
                <h2 class="section-title">详细规格</h2>
                <div class="specifications-table-container">
                    <table class="specifications-table">
                        <tr>
                            <th>处理器</th>
                            <td>麒麟9 Gen3，4nm工艺制程</td>
                        </tr>
                        <tr>
                            <th>显示屏</th>
                            <td>6.8英寸 OLED，2K分辨率，120Hz刷新率，300Hz触控采样率</td>
                        </tr>
                        <tr>
                            <th>后置摄像头</th>
                            <td>5000万像素超感光主摄 + 4000万像素超广角 + 800万像素潜望式长焦</td>
                        </tr>
                        <tr>
                            <th>前置摄像头</th>
                            <td>3200万像素，支持自动对焦</td>
                        </tr>
                        <tr>
                            <th>电池容量</th>
                            <td>5000mAh</td>
                        </tr>
                        <tr>
                            <th>充电规格</th>
                            <td>88W有线快充，50W无线快充</td>
                        </tr>
                        <tr>
                            <th>存储容量</th>
                            <td>256GB / 512GB / 1TB</td>
                        </tr>
                        <tr>
                            <th>运行内存</th>
                            <td>12GB / 16GB</td>
                        </tr>
                        <tr>
                            <th>网络制式</th>
                            <td>5G全网通，Wi-Fi 6E，蓝牙5.3</td>
                        </tr>
                        <tr>
                            <th>操作系统</th>
                            <td>HarmonyOS 4.0</td>
                        </tr>
                        <tr>
                            <th>尺寸重量</th>
                            <td>162.6 x 75.3 x 8.2 mm，约205g</td>
                        </tr>
                        <tr>
                            <th>防护等级</th>
                            <td>IP68</td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>
    </section>

    <!-- 底部固定购物栏 -->
    <div class="sticky-cart" id="stickyCart">
        <div class="sticky-product-info">
            <div class="sticky-product-image">
                <img src="https://picsum.photos/id/1/100/100" alt="华为Mate 70 Pro">
            </div>
            <div>
                <div>华为Mate 70 Pro</div>
                <div style="color:#ef4444;font-weight:600;" id="stickyPrice">¥6,999</div>
            </div>
        </div>
        <button class="btn btn-primary" onclick="buyNow()">⚡ 立即抢购</button>
    </div>

    <!-- 页脚 -->
    <footer>
        <div class="container">
            <div class="footer-content">
                <div class="footer-section">
                    <h3>产品与服务</h3>
                    <ul>
                        <li><a href="#">手机</a></li>
                        <li><a href="#">平板</a></li>
                        <li><a href="#">笔记本</a></li>
                        <li><a href="#">穿戴设备</a></li>
                        <li><a href="#">智能家居</a></li>
                    </ul>
                </div>
                <div class="footer-section">
                    <h3>客户服务</h3>
                    <ul>
                        <li><a href="support.html">售后服务</a></li>
                        <li><a href="#">保修政策</a></li>
                        <li><a href="#">用户手册</a></li>
                        <li><a href="#">常见问题</a></li>
                        <li><a href="#">投诉建议</a></li>
                    </ul>
                </div>
                <div class="footer-section">
                    <h3>关于华为</h3>
                    <ul>
                        <li><a href="about.html">公司简介</a></li>
                        <li><a href="#">新闻中心</a></li>
                        <li><a href="#">投资者关系</a></li>
                        <li><a href="#">可持续发展</a></li>
                        <li><a href="#">加入我们</a></li>
                    </ul>
                </div>
                <div class="footer-section">
                    <h3>全球站点</h3>
                    <ul>
                        <li><a href="#">🇨🇳 中国大陆</a></li>
                        <li><a href="#">🇺🇸 United States</a></li>
                        <li><a href="#">🇪🇺 Europe</a></li>
                        <li><a href="#">🇯🇵 日本</a></li>
                        <li><a href="#">🇰🇷 韩国</a></li>
                    </ul>
                </div>
            </div>
            <div class="footer-bottom">
                <p>&copy; 2025 华为技术有限公司 版权所有 | <a href="#" style="color: #9ca3af;">隐私政策</a> | <a href="#" style="color: #9ca3af;">使用条款</a> | <a href="#" style="color: #9ca3af;">网站地图</a></p>
            </div>
        </div>
    </footer>

    <!-- JavaScript 脚本 -->
    <script>
        // 全局变量存储当前选择的产品信息
        const productInfo = {
            name: "华为Mate 70 Pro",
            price: 6999,
            storage: "256GB",
            color: "雅黑",
            quantity: 1,
            image: "https://picsum.photos/id/1/600/600"
        };

        // DOM 元素缓存
        const elements = {
            mainImage: document.getElementById('mainImage'),
            currentPrice: document.querySelector('.current-price'),
            stickyPrice: document.getElementById('stickyPrice'),
            quantityInput: document.getElementById('quantityInput'),
            cartCount: document.querySelector('.cart-count'),
            loginBtn: document.getElementById('loginBtn'),
            profileBtn: document.getElementById('profileBtn'),
            loginModal: document.getElementById('loginModal'),
            modalClose: document.getElementById('modalClose'),
            loginForm: document.getElementById('loginForm'),
            hamburger: document.getElementById('hamburger'),
            nav: document.querySelector('.nav'),
            stickyCart: document.getElementById('stickyCart'),
            countdown: {
                hours: document.getElementById('hours'),
                minutes: document.getElementById('minutes'),
                seconds: document.getElementById('seconds')
            }
        };

        // 切换主图
        function changeMainImage(imageUrl, altText) {
            elements.mainImage.innerHTML = `<img src="${imageUrl}" alt="${altText}" loading="lazy">`;
            document.querySelectorAll(".thumbnail").forEach(t => t.classList.remove("active"));
            event.target.closest('.thumbnail').classList.add("active");
            productInfo.image = imageUrl;
            
            // 更新底部固定栏的图片
            document.querySelector('.sticky-product-image img').src = imageUrl.replace('600/600', '100/100');
            
            // 重置缩放状态
            elements.mainImage.classList.remove('zoomed');
        }

        // 图片缩放功能
        function toggleImageZoom() {
            elements.mainImage.classList.toggle('zoomed');
        }

        // 选择规格（存储/颜色）
        function selectSpec(element, spec) {
            const parent = element.parentElement;
            parent.querySelectorAll(".spec-option").forEach(opt => opt.classList.remove("selected"));
            element.classList.add("selected");
            
            // 判断是存储还是颜色选择
            if (parent.previousElementSibling.textContent === "存储容量") {
                productInfo.storage = spec;
                // 更新价格
                const price = parseInt(element.getAttribute('data-price'));
                productInfo.price = price;
                elements.currentPrice.textContent = `¥${price.toLocaleString()}`;
                elements.stickyPrice.textContent = `¥${price.toLocaleString()}`;
            } else {
                productInfo.color = spec;
            }
        }

        // 修改数量
        function changeQuantity(delta) {
            let value = parseInt(elements.quantityInput.value) + delta;
            if (value < 1) value = 1;
            if (value > 10) value = 10;
            elements.quantityInput.value = value;
            productInfo.quantity = value;
        }

        // 加入购物车动画
        function createAddToCartAnimation(event) {
            const cartIcon = document.getElementById('cartIcon');
            const cartRect = cartIcon.getBoundingClientRect();
            const btnRect = event.currentTarget.getBoundingClientRect();
            
            // 创建动画元素
            const animationEl = document.createElement('div');
            animationEl.innerHTML = '🛒';
            animationEl.style.position = 'fixed';
            animationEl.style.left = `${btnRect.left + btnRect.width/2}px`;
            animationEl.style.top = `${btnRect.top + btnRect.height/2}px`;
            animationEl.style.transform = 'translate(-50%, -50%)';
            animationEl.style.fontSize = '24px';
            animationEl.classList.add('cart-animation');
            
            document.body.appendChild(animationEl);
            
            // 动画结束后移除元素
            setTimeout(() => {
                document.body.removeChild(animationEl);
            }, 800);
            
            // 购物车数量弹跳动画
            elements.cartCount.classList.add('bounce');
            setTimeout(() => {
                elements.cartCount.classList.remove('bounce');
            }, 500);
        }

        // 加入购物车
        function addToCart(event) {
            const isLoggedIn = Storage.getIsLoggedIn();
            if (!isLoggedIn) {
                alert('请先登录才能使用购物车功能');
                openLoginModal();
                return;
            }
            
            // 创建加入购物车动画
            createAddToCartAnimation(event);
            
            // 获取当前购物车数量并更新
            let currentCount = Storage.getCartCount();
            currentCount += productInfo.quantity;
            Storage.setCartCount(currentCount);
            elements.cartCount.textContent = currentCount;
            
            // 存储购物车详情
            const cartItems = JSON.parse(localStorage.getItem('cartDetails') || '[]');
            cartItems.push({
                name: productInfo.name,
                price: productInfo.price,
                storage: productInfo.storage,
                color: productInfo.color,
                quantity: productInfo.quantity,
                image: productInfo.image
            });
            localStorage.setItem('cartDetails', JSON.stringify(cartItems));
            
            // 显示成功提示
            showToast(`已将 ${productInfo.name} (${productInfo.storage}/${productInfo.color}) ×${productInfo.quantity} 加入购物车`);
        }

        // 立即购买
        function buyNow() {
            const isLoggedIn = Storage.getIsLoggedIn();
            if (!isLoggedIn) {
                alert('请先登录才能购买商品');
                openLoginModal();
                return;
            }
            
            // 将当前选择的商品信息存储到本地，供结算页面使用
            localStorage.setItem('currentProduct', JSON.stringify(productInfo));
            // 跳转到结算页面
            window.location.href = "checkout.html";
        }

        // 显示提示消息
        function showToast(message) {
            // 创建提示元素
            const toast = document.createElement('div');
            toast.textContent = message;
            toast.style.position = 'fixed';
            toast.style.bottom = '80px';
            toast.style.left = '50%';
            toast.style.transform = 'translateX(-50%)';
            toast.style.backgroundColor = 'rgba(0, 0, 0, 0.8)';
            toast.style.color = 'white';
            toast.style.padding = '12px 20px';
            toast.style.borderRadius = '8px';
            toast.style.zIndex = '9999';
            toast.style.transition = 'all 0.3s ease';
            
            // 添加到页面
            document.body.appendChild(toast);
            
            // 3秒后移除
            setTimeout(() => {
                toast.style.opacity = '0';
                setTimeout(() => {
                    document.body.removeChild(toast);
                }, 300);
            }, 3000);
        }

        // 打开登录模态框 - 直接跳转到登录页面
        function openLoginModal() {
            window.location.href = 'login.html';
        }

        // 关闭登录模态框
        function closeLoginModal() {
            elements.loginModal.classList.remove('show');
            document.body.style.overflow = '';
        }

        // 滚动时显示底部固定购物栏
        window.addEventListener("scroll", function() {
            if (window.scrollY > 500) {
                elements.stickyCart.classList.add("show");
            } else {
                elements.stickyCart.classList.remove("show");
            }
        });

        // 限时优惠倒计时
        function startCountdown() {
            // 设置倒计时结束时间（当前时间 + 12小时34分56秒）
            const endTime = new Date();
            endTime.setHours(endTime.getHours() + 12);
            endTime.setMinutes(endTime.getMinutes() + 34);
            endTime.setSeconds(endTime.getSeconds() + 56);
            
            function updateCountdown() {
                const now = new Date();
                const diff = endTime - now;
                
                if (diff <= 0) {
                    elements.countdown.hours.textContent = '00';
                    elements.countdown.minutes.textContent = '00';
                    elements.countdown.seconds.textContent = '00';
                    return;
                }
                
                const hours = Math.floor(diff / (1000 * 60 * 60));
                const minutes = Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60));
                const seconds = Math.floor((diff % (1000 * 60)) / 1000);
                
                elements.countdown.hours.textContent = hours.toString().padStart(2, '0');
                elements.countdown.minutes.textContent = minutes.toString().padStart(2, '0');
                elements.countdown.seconds.textContent = seconds.toString().padStart(2, '0');
            }
            
            // 立即更新一次
            updateCountdown();
            // 每秒更新一次
            setInterval(updateCountdown, 1000);
        }

        // 登录表单提交
        function handleLoginSubmit(e) {
            e.preventDefault();
            const username = document.getElementById('username').value.trim();
            const password = document.getElementById('password').value.trim();

            // 基础表单验证
            if (!username || !password) {
                alert('请输入账号和密码');
                return;
            }

            // 模拟登录成功
            Storage.setIsLoggedIn('true');
            updateLoginState();
            closeLoginModal();
            showToast('登录成功！您现在可以使用购物车和个人中心功能');
        }

        // 移动端汉堡菜单控制
        function toggleHamburger() {
            elements.nav.classList.toggle('active');
            elements.hamburger.classList.toggle('active');
            const isActive = elements.nav.classList.contains('active');
            elements.hamburger.setAttribute('aria-expanded', isActive);
        }

        // 购物车点击事件 - 核心逻辑优化
        function handleCartClick() {
            const isLoggedIn = Storage.getIsLoggedIn();
            if (isLoggedIn) {
                // 已登录状态，跳转到购物车页面
                window.location.href = 'cart.html';
            } else {
                // 未登录状态，跳转到登录页面
                window.location.href = 'login.html';
            }
        }

        // 个人中心点击事件
        function handleProfileClick() {
            const isLoggedIn = Storage.getIsLoggedIn();
            if (!isLoggedIn) {
                alert('请先登录才能进入个人中心');
                openLoginModal();
                return;
            }
            // 已登录，跳转到个人中心页面
            window.location.href = 'user-center.html';
        }

        // localStorage 操作封装
        const Storage = {
            getIsLoggedIn: () => localStorage.getItem('isLoggedIn') === 'true',
            setIsLoggedIn: (value) => localStorage.setItem('isLoggedIn', value),
            getCartCount: () => parseInt(localStorage.getItem('cartItems')) || 0,
            setCartCount: (count) => localStorage.setItem('cartItems', count),
            getLastClear: () => parseInt(localStorage.getItem('lastClear')) || 0,
            setLastClear: (time) => localStorage.setItem('lastClear', time),
            clearCart: () => {
                localStorage.removeItem('cartItems');
                localStorage.removeItem('cartDetails');
            },
            clearLogin: () => localStorage.removeItem('isLoggedIn')
        };

        // 自动清理缓存（24小时周期）
        function autoClearCache() {
            const now = Date.now();
            const cacheExpire = 24 * 60 * 60 * 1000; // 24小时
            const lastClear = Storage.getLastClear();

            if (now - lastClear > cacheExpire) {
                console.log('🧹 自动清理缓存：超过24小时');
                Storage.clearCart();
                Storage.clearLogin();
                Storage.setLastClear(now);
                elements.cartCount.textContent = 0;
                updateLoginState();
            }
        }

        // 更新登录状态UI
        function updateLoginState() {
            const isLoggedIn = Storage.getIsLoggedIn();

            if (isLoggedIn) {
                elements.loginBtn.disabled = true;
                elements.loginBtn.classList.add('disabled-btn');
                elements.loginBtn.textContent = '已登录';
                elements.profileBtn.disabled = false;
                elements.profileBtn.classList.remove('disabled-btn');
            } else {
                elements.loginBtn.disabled = false;
                elements.loginBtn.classList.remove('disabled-btn');
                elements.loginBtn.textContent = '登录';
                elements.profileBtn.disabled = true;
                elements.profileBtn.classList.add('disabled-btn');
                Storage.clearCart();
                elements.cartCount.textContent = 0;
            }
        }

        // 页面加载初始化
        window.addEventListener('load', function() {
            // 初始化登录状态
            updateLoginState();
            
            // 初始化购物车数量
            elements.cartCount.textContent = Storage.getCartCount();
            
            // 绑定事件
            elements.cartIcon.addEventListener('click', handleCartClick);
            elements.hamburger.addEventListener('click', toggleHamburger);
            elements.modalClose.addEventListener('click', closeLoginModal);
            elements.loginForm.addEventListener('submit', handleLoginSubmit);
            
            // 点击模态框外部关闭
            elements.loginModal.addEventListener('click', function(e) {
                if (e.target === elements.loginModal) {
                    closeLoginModal();
                }
            });
            
            // 开始倒计时
            startCountdown();
            
            // 自动清缓存检查
            autoClearCache();
            // 每小时检查一次缓存
            setInterval(autoClearCache, 60 * 60 * 1000);
        });
    </script>
</body>

</html>
